import { Define, EntityObjectFactory } from 'tiny-entity2';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');

@Define.Table({ TableName: "imagestore" })
export class ImageStore extends EntityObjectType<ImageStore>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({ DataType: Define.DataType.VARCHAR, IsIndex: true, NotAllowNULL: true })
    objectId: string;

    @Define.Column({ DataType: Define.DataType.VARCHAR, IsIndex: true, NotAllowNULL: true })
    objectType: string;

    @Define.Column({ DataType: Define.DataType.VARCHAR })
    url: string;

    base64: string;

    @Define.Column({ DataType: Define.DataType.VARCHAR })
    size: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    storeId: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    createTime: number;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    version: number;
}